#ifndef _NVM_H__
#define _NVM_H__

#include "os/types.h"

#define NVM_ERR_NO 0
#define NVM_PARAM_ERR -1
#define NVM_ERR_CRC -2
#define NVM_ERR_LEN -3
#define NVM_ERR_EMPTY -4

#define CONFIG_NVM_PICES_0 0
#define CONFIG_NVM_PICES_1 1
#define CONFIG_NVM_PICES_2 2

#define CONFIG_NVM_PICES_NUM 3

void nvm_init(u32 flash_addr[], u32 sizes[]); // for simulink
void nvm2_init(int nvm_nr, u32 flash_addr[], u32 flash_size);
s32 nvm_read(u32 nvm_nr, u8 *buffer, u32 len);
s32 nvm_write(u32 nvm_nr, u8 *buffer, u32 len);
void nvm_test(void);
#endif /*_NVM_H__ */

